#pragma once
#include <easyx.h>
#include <conio.h>
#include <iostream>

class TextBox
{
private:
	int		m_x1, m_y1, m_x2, m_y2;		// The coordinate of the textbox
	char	m_text[10000];				// The string user typed in
	int		m_textlen;					// The length of the string
	int		m_fps;						// Decision the sparkle speed of the cursor

public:
	// Ctor
	TextBox(int x1, int  y1, int x2, int y2, int fps);

	// Append a character to the end of the text
	void Append(char c);

	// Clear the text
	void Empty();

	// Draw the text box
	void Draw();

	// Get the input character
	char Input();

	// Return the text
	char* getText() { return m_text; }
};
